import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { MemberService } from '../../service/memberService'

@Component({
  selector: 'app-monument',
  templateUrl: './monument.component.html',
  styleUrls: ['./monument.component.css'],
})
export class MonumentComponent implements OnInit {

  cols:any[];
  activeMembers:any[];
  nineteenMembers:any[];
  constructor(public location:Location,
            public memberService:MemberService) { }

  ngOnInit(): void {
    this.cols = [
      { field: 'name', header: '姓名' },
      { field: 'academy', header:'学院'},
      { field: 'expert', header:'主要工作'},
      { field: 'email', header:'邮箱'}
    ];

  this.getActiveMembers();
  this.get2019Members();
  }
  getActiveMembers(){
    this.memberService.getMembers("绿茵争锋").subscribe(datas=>{
      this.activeMembers = datas;
    })
  }
  get2019Members(){
    this.memberService.getMembers("快马加鞭").subscribe(datas=>{
      this.nineteenMembers = datas;
    })
  }
  back(){
    this.location.back();
  }

}
